﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Data.SqlClient;
using yunbo.Model.SM;
using yunbo.Repositorys.SMRepositorys;
using static System.Runtime.InteropServices.JavaScript.JSType;

namespace yunbo.Controllers.SMControllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class WMS_RKController : ControllerBase
    {
        WMS_RKRepository wMS_RKRepository=new WMS_RKRepository();
        /// <summary>
        /// 添加
        /// </summary>
        /// <returns></returns>
        [HttpPost("PostWMS_RK")]
        public IActionResult PostWMS_RK(TJWMS_RK tJWMS_RK)
        {
            tJWMS_RK.create_time = DateTime.Now;
            tJWMS_RK.rk_state = 1;
            //tJWMS_RK.rk_type = "调拨入库";
            bool rs= wMS_RKRepository.PostWMS_RK(tJWMS_RK)>0;
            return Ok(rs);
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        [HttpGet("GetCXWMS_RK")]
        public IActionResult GetCXWMS_RK(int PageNumber, int PageSize)
        {
            FYCXWMS_RK fYCXWMS_RK = wMS_RKRepository.GetCXWMS_RK(PageNumber, PageSize);
            return Ok(fYCXWMS_RK);
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <returns></returns>
        [HttpPut("UpdatWMS_RK")]
        public IActionResult UpdatWMS_RK(int fzr, int uid, string code,int zt)
        {
            bool rs = wMS_RKRepository.UpdatWMS_RK(fzr, uid, code,zt)>0;
            return Ok(rs);
        }
    }
}
